adaptertest: fix goroutine/test lifecycle race in testReleasing#195
adaptertest: fix goroutine/test lifecycle race in testReleasing#195andrewwormald wants to merge 1 commit intomainfrom
Conversation
require.NoError and require.ErrorIs were called inside goroutines that could outlive the test when the 5-second timeout path fired. Move all assertions into the test goroutine by communicating results back via buffered error channels. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe test in Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
|



Summary
testReleasingspawned two nested goroutines that calledrequire.NoErrorandrequire.ErrorIsdirectly. When the 5-second timeout path fired, the test completed before those goroutines finished, causing a panic:Fix: replace the in-goroutine
require.*calls with buffered error channels (outerErr,innerErr) and assert in the test goroutine, which is the correct pattern per the Go testing docs.Test plan
go test ./adapters/memrolescheduler/... -count=10 -racepasses (verified locally atcount=5)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
No end-user visible changes. This release includes internal test infrastructure improvements to enhance test reliability and error handling.